# -*- coding: utf-8 -*-

import unittest

import logging
logging.basicConfig(filename="test.log",level=logging.DEBUG,format='%(name)s:%(funcName)s:%(lineno)d:%(asctime)s %(levelname)s %(message)s')

from wolfox.foxit.dune.test_common import prepare,clean
#用到的v1.0相关模块的测试
from wolfox.foxit.source.fxj_test import FxjTest,CodeReaderTest,CatalogReaderTest
from wolfox.foxit.source.common_test import CommonTest
from wolfox.foxit.source.reader_test import NullFilterTest,CodeFilterTest,DateFilterTest,ReaderTest
#v1.0中calculator的测试，已经不需要，由fengine代替
#from wolfox.test.calculator.dateutilstest import ModuleTest as DateUtilsModuleTest
#from wolfox.test.calculator.basictest import ModuleTest as CalculatorBasicModuleTest
#from wolfox.test.calculator.commontest import ModuleTest as CalculatorCommonModuleTest
#from wolfox.test.calculator.futuretest import ModuleTest as CalculatorFutureModuleTest
#from wolfox.test.calculator.idiomtest import ModuleTest as CalculatorIdiomModuleTest
#from wolfox.test.calculator.klinetest import ModuleTest as CalculatorKlineModuleTest
#from wolfox.test.calculator.matchtest import ModuleTest as CalculatorMatchModuleTest
#from wolfox.test.calculator.peaktest import ModuleTest as CalculatorPeakModuleTest
#from wolfox.test.calculator.relationtest import ModuleTest as CalculatorRelationModuleTest
#from wolfox.test.calculator.rwarmstest import ModuleTest as CalculatorRwarmsModuleTest
#from wolfox.test.calculator.sarithtest import ModuleTest as CalculatorSArithModuleTest
#引入test
from wolfox.foxit.base.tutils_test import ModuleTest as TutilsModuleTest
from wolfox.foxit.base.common_test import QuoteTest
from wolfox.foxit.base.common_test import XInfoTest
from wolfox.foxit.base.common_test import ReportTest
from wolfox.foxit.dune.store_test import NormalStoreTest,SqlStoreTest
from wolfox.foxit.source.common_test import CommonTest as SourceCommonTest
from wolfox.foxit.source.transfer_test import TransferTest,ModuleTest as TransferModuleTest
from wolfox.foxit.dune.dyn_service_test import DynDataTest,BasicDataTest,ModuleTest as DynDataModuleTest

#从fengine中引入数据库相关测试，确定不引入，而由其单独测试
#from wolfox.fengine.core.source_test2 import ModuleTest as FengineSourceTest

"""
class PreparedSuite(unittest.TestSuite):
    def run(self,result):
        '''在run之前初始化数据表是有问题的。必须每个运行之前再初始化表中数据

           不需要调用clean,因为是内存数据库,执行完后自然解构
        '''
        #prepare()
        return super(PreparedSuite,self).run(result)
"""

''' #不必特意定义suite,会自动采集
def suite():
    suite1 = unittest.TestLoader().loadTestsFromTestCase(NormalStoreTest)
    suite2 = unittest.TestLoader().loadTestsFromTestCase(SqlStoreTest)
    return unittest.TestSuite([suite1, suite2])
    #return PreparedSuite([suite1, suite2])
''' 

